Skip to content

Conversation

@strangelookingnerd
Copy link
Contributor

@strangelookingnerd strangelookingnerd commented Jan 16, 2025

Now that jenkinsci/jenkins-test-harness#716 is available, it is possible to replace usage of RestartableJenkinsRule in most scenarios.
This change paves the way to provide a JUnit5-compatible implementation of RoundTripAbstractTest that does not rely on RestartableJenkinsRule anymore.

Your checklist for this pull request

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or in Jenkins JIRA
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Did you provide a test-case? That demonstrates feature works or fixes the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good example of how one can migrate from using RestartableJenkinsRule to JenkinsRule.restart()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an example of how one can migrate from using RoundTripAbstractTest to AbstractRoundTripTest

* text configured.
*
* @since 1.20
* @deprecated Consider migrating to JUnit5 and use {@link io.jenkins.plugins.casc.misc.junit.jupiter.AbstractRoundTripTest} instead.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is optional, but I'd like to make users aware of the alternative.

* logger) that guarantees the config is loaded. Usually a weird text configured.
*/
@WithJenkins
public abstract class AbstractRoundTripTest {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used a slightly different name besides a different package to reduce the risk of mix-ups. Not sure if this is the best way, so feedback is welcome.

@strangelookingnerd strangelookingnerd marked this pull request as ready for review January 28, 2025 10:33
@strangelookingnerd strangelookingnerd requested a review from a team as a code owner January 28, 2025 10:33
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@timja timja merged commit 036b5ae into jenkinsci:master Jan 28, 2025
17 checks passed
@strangelookingnerd strangelookingnerd deleted the alternative_for_restartable_jenkins_rule branch January 28, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants